I'm not sure about this "better jpeg result" compared to D50, but say if it's so, I'm quite sure that it's because of more aggresive in-camera post processing (to suit someone coming from P&S) rather than the ability to capture more details.
It's good that D50 is even cheaper than D40, that's a freakin no brainer. Must be a sign of D50 being discontinued soon. Get it while you can IMO.
Machi, since you are buying the lens in HK and is considerably cheap compared to Sydney price, why not just get a better lens straight away? It will be cheaper than buying it here, especially since you're getting body, tripod, SD card, and whatnot, I think it will be easier to bargain with the shop.
But seriously, don't back track and think about D40 anymore. I have nothing against it, and I also know it can deliver great result in the right hand, but D50 is just a better camera overall than D40, period. There are too many things in D40 that it's lacking it doesn't feel like an SLR anymore.
Get yourself a D50 and get the best lens you can afford. This is the
example what a cheap body combined with a good lens can give you. Of course the lens he used is ridiculously expensive, but I'm just emphasising my point of don't cheap out on lens if you are serious with image quality.
You can also consider 20mm 2.8 AFD if you want wide, but it's more expensive than 18-70mm.