Fixes for prologue and scheduler

- fixed scratch directory creation (reports error if couldn't be created)
- fixed not checked result of GPU allocation
- fixed scheduler problem with fairshare calculation