Allow callers to set mode on packfile creation

Take a handy mode so that callers can create read/writeable packfiles.  Handy on Windows where deleting readonly files is disappointingly (but not surprisingly) painful.