use promises to deal with filesystem permissions, closes #6, fixes exception upon successful record upload if user has not approved filesystem usage, https://github.com/MartijnR/enketo/issues/301