Merge pull request #2546 from archtaku/develop

Fix "variable referenced before assignment"
An easy fix on opening files
Add Some initial docs to stateconf
Open file with with statement
Make salt-call register to the job cache
Clean up some oversights in caller.py
fix docstring
Use with statements when opening files
clean up some strings and update esky update to use config.option
Add is_running function to saltutil
Add check for existing state runs
PEP-8 corrections.
Switch open calls to our fopen call which sets `CLOEXEC` on the fd.
Added `salt.utils.mkstemp()` as a helper.

Will ease the use of `fd_, fpath = tempfile.mkstemp(); os.close(fd_)`.
Also switch cron to `salt.utils.mkstemp()`.
Added `salt.utils.mkstemp()` as a helper.

Will ease the use of `fd_, fpath = tempfile.mkstemp(); os.close(fd_)`.
Add missing import.
Remove unused import.
Add required `close_fd=False` to keep the `fd` open.
Fixed typo in the raw outputter