Given an array of pin objects, write a function to group them by category and sort them by popularity within a specific time window.
Use group_pins_by_category(pins, start_time, end_time). Each pin is a dictionary with id, category, popularity, and integer timestamp fields. Include pins whose timestamps fall inclusively within the window. Return a dictionary mapping each category to a list of its matching pin objects, sorted by descending popularity; break popularity ties by ascending id.
def group_pins_by_category(pins, start_time, end_time):