Add helper in tests/mesos.hpp to create task with resources

Review: https://reviews.apache.org/r/22048