Fixed PUT request to /scheduler/task/id to return error 500 when task_id is not valid.

See ticket number #49