The Optional Sampling Theorem for Martingales Indexed by Directed Sets