Ticket #1041 The CA serial file was getting owned by root because it was using a different method to write to file
Pulled the readwritelock out of lib/puppet/sslcertificates/ca.rb into lib/puppet/util/settings.rb
Refactored write, writesub and readwritelock a bit to reuse code
(write and readwritelock both call writesub)
Added a mode to :serial in lib/puppet/util/defaults.rb