Clone template flock master

Forward port pull requests 427 and 452

Clone template flock

Fixes lp:1311668, lp:1351004

Use flock to serialise lxc template creation rather than juju/utils/fslock