Task Queue retry tests

Added test case to add task that fails and then succeeds to test task retrying. Altered Python and Java sample apps accordingly.