Use the correct datafile name for generated py script. Refs #7636.

- Use the datafile name to obtain the dataset ID unless the user wants to provide the specific run number.
Improved error message. Refs #7636.
Handle errors returned by the IDS. Refs #7636.

- It's not possible to throw a runtime_error as poco catches it, then throws another I/O error instead! This is related to a bug in POCO 1.4 (http://sourceforge.net/p/poco/bugs/403/). Instead, I have logged the message and informed the user of the possible problems.
- This "error handling" will be improved on the GUI, but needs to exist as is for when user's write scripts against this algorithm.
User must be logged into ICAT to publish. Refs #7636.