Add support for client binary on upgrade

Went ahead and implemented this, looking for feedback, how do those file permissions look to you?

ping @SvenDowideit @tianon 
This ought to be moved outside the function so it only has to be compiled once (which doesn't matter much here, but helps enforce a good pattern).