This is what I suggest you do.
1. Backup OSX - Time Machine or any other tool of your choice.
2. Backup Windows - Windows Backup/Restore or any other tool of your choice.
3. Install OSX on external volume - OS X: Installing OS X on an external volume - Apple Support (for safety and external boot if necessary). Please ensure that the external volume has Recovery HD which should be the same version as what you currently have.
4. Merge disk chunks. Please be very careful with these steps. Do not touch disk0s4 with any commands. Verify that the MBR for Windows is correct and points to the correct start/size as shown in the current GPT. The GPT index will change after merge.
a. Merge disk0s2, disk0s3 - diskutil mergePartitions disk0s2 disk0s3
b. Run Disk Utility and drag the bottom right to cover the ~8.6GB Free Space.
c. Use the external volume to boot and re-install OSX or use Internet Recovery (spinning globe is a must) and re-install OSX and
re-build Recovery HD.
5. Backup OSX again for future recovery baseline.
6. Stop if you see any errors.
Here is the help information for mergePartitions verb.
diskutil mergePartitions
Usage: diskutil mergePartitions [force] format name
DiskIdentifier|DeviceNode DiskIdentifier|DeviceNode
Merge two or more pre-existing partitions into one. The first disk parameter
is the starting partition; the second disk parameter is the ending partition;
this given range of two or more partitions will be merged into one.
All partitions in the range, except for the first one, must be unmountable.
All data on merged partitions other than the first will be lost; data on the
first partition will be lost as well if the "force" argument is given.
If "force" is not given, and the first partition has a resizable file system
(e.g. JHFS+), it will be grown in a data-preserving manner, even if a different
file system is specified (in fact, your file system and volume name parameters
are both ignored in this case). If "force" is not given, and the first
partition is not resizable, you will be prompted if you want to erase.
If "force" is given, the first partition is always formatted. You should
do this if you wish to reformat to a new file system type.
Merged partitions are required to be ordered sequentially on disk.
See diskutil list for the actual on-disk ordering; BSD slice identifiers
may in certain circumstances not always be in numerical order but the
top-to-bottom order given by diskutil list is always the on-disk order.
Ownership of the affected disk is required.
Example: diskutil mergePartitions JHFS+ NewName disk3s4 disk3s7
This example will merge all partitions *BETWEEN* disk3s4 and disk3s7,
preserving data on disk3s4 but destroying data on disk3s5, disk3s6,
disk3s7 and any invisible free space partitions between those disks;
disk3s4 will be grown to cover the full space if possible.