Josh McRoberts agrees to mid-level deal with the Miami Heat